package view.employee;

import javax.swing.BorderFactory;
import javax.swing.DefaultComboBoxModel;
import javax.swing.GroupLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.LayoutStyle;
import javax.swing.border.TitledBorder;

import lib.MyUtils;
import controller.employee.EmployeeControl;

public class EmployeeMainPanel extends JPanel {
	private static final long serialVersionUID = 1L;
	private JButton btnEmAdd;
	private JButton btnEmCancel;
	private JButton btnEmDelete;
	private JButton btnEmEdit;
	private JButton btnEmSearch;
	private JButton btnEmUpdate;
	private JComboBox<String> cbbEmSearchby;
	private JComboBox<String> cbbEmSex;
	private com.toedter.calendar.JDateChooser dateEmBirthday;
	private JScrollPane jScrollPane1;
	private JScrollPane jScrollPane2;
	private JLabel lblEmAddemacc;
	private JLabel lblEmAddress;
	private JLabel lblEmBirthday;
	private JLabel lblEmBy;
	private JLabel lblEmEmail;
	private JLabel lblEmId;
	private JLabel lblEmName;
	private JLabel lblEmPassword;
	private JLabel lblEmPersonalID;
	private JLabel lblEmPhone;
	private JLabel lblEmSex;
	private JPanel pnEmInformation;
	private JPanel pnEmmainListem;
	private JSeparator spEmAddemacc1;
	private JSeparator spEmAddemacc2;
	private JTable tblEmListem;
	private JTextField txtEmEmail;
	private JTextField txtEmId;
	private JTextField txtEmName;
	private JPasswordField txtEmPassword;
	private JTextField txtEmPersonalID;
	private JTextField txtEmPhone;
	private JTextField txtEmSearch;
	private JTextArea txtaEmAddress;

	private EmployeeControl controller;
	
	public EmployeeMainPanel() {
		initComponents();
		MyUtils.doLoadEmployee(this);
	}

	public JPanel getPnEmInformation() {
		return pnEmInformation;
	}

	public void setPnEmInformation(JPanel pnEmInformation) {
		this.pnEmInformation = pnEmInformation;
	}

	public JPanel getPnEmmainListem() {
		return pnEmmainListem;
	}

	public void setPnEmmainListem(JPanel pnEmmainListem) {
		this.pnEmmainListem = pnEmmainListem;
	}

	public JButton getBtnEmAdd() {
		return btnEmAdd;
	}

	public void setBtnEmAdd(JButton btnEmAdd) {
		this.btnEmAdd = btnEmAdd;
	}

	public JButton getBtnEmCancel() {
		return btnEmCancel;
	}

	public void setBtnEmCancel(JButton btnEmCancel) {
		this.btnEmCancel = btnEmCancel;
	}

	public JButton getBtnEmDelete() {
		return btnEmDelete;
	}

	public void setBtnEmDelete(JButton btnEmDelete) {
		this.btnEmDelete = btnEmDelete;
	}

	public JButton getBtnEmEdit() {
		return btnEmEdit;
	}

	public void setBtnEmEdit(JButton btnEmEdit) {
		this.btnEmEdit = btnEmEdit;
	}

	public JButton getBtnEmSearch() {
		return btnEmSearch;
	}

	public void setBtnEmSearch(JButton btnEmSearch) {
		this.btnEmSearch = btnEmSearch;
	}

	public JButton getBtnEmUpdate() {
		return btnEmUpdate;
	}

	public void setBtnEmUpdate(JButton btnEmUpdate) {
		this.btnEmUpdate = btnEmUpdate;
	}

	public JComboBox<String> getCbbEmSearchby() {
		return cbbEmSearchby;
	}

	public void setCbbEmSearchby(JComboBox<String> cbbEmSearchby) {
		this.cbbEmSearchby = cbbEmSearchby;
	}

	public JComboBox<String> getCbbEmSex() {
		return cbbEmSex;
	}

	public void setCbbEmSex(JComboBox<String> cbbEmSex) {
		this.cbbEmSex = cbbEmSex;
	}

	public com.toedter.calendar.JDateChooser getDateEmBirthday() {
		return dateEmBirthday;
	}

	public void setDateEmBirthday(
			com.toedter.calendar.JDateChooser dateEmBirthday) {
		this.dateEmBirthday = dateEmBirthday;
	}

	public JTable getTblEmListem() {
		return tblEmListem;
	}

	public void setTblEmListem(JTable tblEmListem) {
		this.tblEmListem = tblEmListem;
	}

	public JTextField getTxtEmEmail() {
		return txtEmEmail;
	}

	public void setTxtEmEmail(JTextField txtEmEmail) {
		this.txtEmEmail = txtEmEmail;
	}

	public JTextField getTxtEmId() {
		return txtEmId;
	}

	public void setTxtEmId(JTextField txtEmId) {
		this.txtEmId = txtEmId;
	}

	public JTextField getTxtEmName() {
		return txtEmName;
	}

	public void setTxtEmName(JTextField txtEmName) {
		this.txtEmName = txtEmName;
	}

	public JTextField getTxtEmPassword() {
		return txtEmPassword;
	}

	public void setTxtEmPassword(JPasswordField txtEmPassword) {
		this.txtEmPassword = txtEmPassword;
	}

	public JTextField getTxtEmPersonalID() {
		return txtEmPersonalID;
	}

	public void setTxtEmPersonalID(JTextField txtEmPersonalID) {
		this.txtEmPersonalID = txtEmPersonalID;
	}

	public JTextField getTxtEmPhone() {
		return txtEmPhone;
	}

	public void setTxtEmPhone(JTextField txtEmPhone) {
		this.txtEmPhone = txtEmPhone;
	}

	public JTextField getTxtEmSearch() {
		return txtEmSearch;
	}

	public void setTxtEmSearch(JTextField txtEmSearch) {
		this.txtEmSearch = txtEmSearch;
	}

	public JTextArea getTxtaEmAddress() {
		return txtaEmAddress;
	}

	public void setTxtaEmAddress(JTextArea txtaEmAddress) {
		this.txtaEmAddress = txtaEmAddress;
	}

	private void initComponents() {
		controller = new EmployeeControl(this);
		pnEmmainListem = new JPanel();
		jScrollPane1 = new JScrollPane();
		tblEmListem = new JTable();
		txtEmSearch = new JTextField();
		lblEmBy = new JLabel();
		cbbEmSearchby = new JComboBox<String>();
		btnEmSearch = new JButton();
		pnEmInformation = new JPanel();
		lblEmName = new JLabel();
		txtEmName = new JTextField();
		txtEmPersonalID = new JTextField();
		lblEmPersonalID = new JLabel();
		lblEmAddress = new JLabel();
		txtEmEmail = new JTextField();
		lblEmEmail = new JLabel();
		txtEmPhone = new JTextField();
		lblEmPhone = new JLabel();
		lblEmSex = new JLabel();
		cbbEmSex = new JComboBox<String>();
		dateEmBirthday = new com.toedter.calendar.JDateChooser();
		lblEmBirthday = new JLabel();
		txtEmId = new JTextField();
		txtEmId.setEditable(true);
		txtEmPassword = new JPasswordField();
		spEmAddemacc2 = new JSeparator();
		lblEmAddemacc = new JLabel();
		spEmAddemacc1 = new JSeparator();
		lblEmId = new JLabel();
		lblEmPassword = new JLabel();
		btnEmDelete = new JButton();
		btnEmUpdate = new JButton();
		btnEmEdit = new JButton();
		jScrollPane2 = new JScrollPane();
		txtaEmAddress = new JTextArea();
		btnEmAdd = new JButton();
		btnEmCancel = new JButton();
		btnEmAdd = new JButton();
		btnEmCancel = new JButton();

		setPreferredSize(new java.awt.Dimension(906, 480));

		pnEmmainListem.setBackground(new java.awt.Color(255, 255, 255));
		pnEmmainListem.setBorder(BorderFactory.createTitledBorder(null,
				"List Employee", TitledBorder.DEFAULT_JUSTIFICATION,
				TitledBorder.DEFAULT_POSITION, new java.awt.Font("Calibri", 1,
						12), java.awt.Color.blue));
		
		tblEmListem.setFont(new java.awt.Font("Calibri", 1, 12));
		tblEmListem.addMouseListener(new EmployeeControl(this));
		tblEmListem.setEnabled(true);
		tblEmListem.addMouseListener(new EmployeeControl(this));
		
		jScrollPane1.setViewportView(tblEmListem);

		lblEmBy.setText("by");

		cbbEmSearchby.setModel(new DefaultComboBoxModel<String>(new String[] {
				"ALL"}));

		btnEmSearch.setFont(new java.awt.Font("Calibri", 1, 12));
		btnEmSearch.setIcon(new ImageIcon("icon/search.png"));
		btnEmSearch.setText("Search");

		GroupLayout pn_emmain_listemLayout = new GroupLayout(pnEmmainListem);
		pnEmmainListem.setLayout(pn_emmain_listemLayout);
		pn_emmain_listemLayout
				.setHorizontalGroup(pn_emmain_listemLayout
						.createParallelGroup(GroupLayout.Alignment.LEADING)
						.addGroup(
								GroupLayout.Alignment.TRAILING,
								pn_emmain_listemLayout
										.createSequentialGroup()
										.addContainerGap(
												GroupLayout.DEFAULT_SIZE,
												Short.MAX_VALUE)
										.addComponent(txtEmSearch,
												GroupLayout.PREFERRED_SIZE,
												151, GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(
												LayoutStyle.ComponentPlacement.UNRELATED)
										.addComponent(lblEmBy)
										.addPreferredGap(
												LayoutStyle.ComponentPlacement.UNRELATED)
										.addComponent(cbbEmSearchby,
												GroupLayout.PREFERRED_SIZE, 79,
												GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(
												LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(btnEmSearch,
												GroupLayout.PREFERRED_SIZE, 90,
												GroupLayout.PREFERRED_SIZE)
										.addContainerGap())
						.addComponent(jScrollPane1,
								GroupLayout.Alignment.TRAILING));
		pn_emmain_listemLayout
				.setVerticalGroup(pn_emmain_listemLayout
						.createParallelGroup(GroupLayout.Alignment.LEADING)
						.addGroup(
								GroupLayout.Alignment.TRAILING,
								pn_emmain_listemLayout
										.createSequentialGroup()
										.addGroup(
												pn_emmain_listemLayout
														.createParallelGroup(
																GroupLayout.Alignment.BASELINE)
														.addComponent(
																txtEmSearch,
																GroupLayout.PREFERRED_SIZE,
																GroupLayout.DEFAULT_SIZE,
																GroupLayout.PREFERRED_SIZE)
														.addComponent(lblEmBy)
														.addComponent(
																cbbEmSearchby,
																GroupLayout.PREFERRED_SIZE,
																GroupLayout.DEFAULT_SIZE,
																GroupLayout.PREFERRED_SIZE)
														.addComponent(
																btnEmSearch))
										.addPreferredGap(
												LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(jScrollPane1,
												GroupLayout.DEFAULT_SIZE, 159,
												Short.MAX_VALUE)));

		pnEmInformation.setBackground(new java.awt.Color(255, 255, 255));
		pnEmInformation.setBorder(BorderFactory.createTitledBorder(null,
				"Information", TitledBorder.DEFAULT_JUSTIFICATION,
				TitledBorder.DEFAULT_POSITION, new java.awt.Font("Calibri", 1,
						12), java.awt.Color.blue));

		lblEmName.setFont(new java.awt.Font("Calibri", 0, 12));
		lblEmName.setText("Name:");

		lblEmPersonalID.setFont(new java.awt.Font("Calibri", 0, 12));
		lblEmPersonalID.setText("Personal ID:");

		lblEmAddress.setFont(new java.awt.Font("Calibri", 0, 12));
		lblEmAddress.setText("Address:");

		lblEmEmail.setFont(new java.awt.Font("Calibri", 0, 12));
		lblEmEmail.setText("Email:");

		lblEmPhone.setFont(new java.awt.Font("Calibri", 0, 12));
		lblEmPhone.setText("Phone:");

		lblEmSex.setFont(new java.awt.Font("Calibri", 0, 12));
		lblEmSex.setText("Sex:");

		cbbEmSex.setModel(new DefaultComboBoxModel<String>(new String[] {
				"male", "female", "orther" }));

		lblEmBirthday.setFont(new java.awt.Font("Calibri", 0, 12));
		lblEmBirthday.setText("Birthday:");

		lblEmAddemacc.setBackground(new java.awt.Color(204, 204, 255));
		lblEmAddemacc.setText("Add Employee's account");

		lblEmId.setText("ID:");

		lblEmPassword.setText("Password:");

		btnEmDelete.setFont(new java.awt.Font("Calibri", 1, 12));
		btnEmDelete.setIcon(new ImageIcon("icon/em_delete.png"));
		btnEmDelete.setText("Delete");
		btnEmDelete.setEnabled(false);

		btnEmUpdate.setFont(new java.awt.Font("Calibri", 1, 12));
		btnEmUpdate.setIcon(new ImageIcon("icon/save.png"));
		btnEmUpdate.setText("Update");
		btnEmUpdate.setEnabled(false);

		btnEmEdit.setFont(new java.awt.Font("Calibri", 1, 12));
		btnEmEdit.setIcon(new ImageIcon("icon/em_edit.png"));
		btnEmEdit.setText("Edit");
		btnEmEdit.setEnabled(false);

		txtaEmAddress.setColumns(20);
		txtaEmAddress.setRows(5);
		jScrollPane2.setViewportView(txtaEmAddress);

		GroupLayout pn_emmain_informationLayout = new GroupLayout(
				pnEmInformation);
		pnEmInformation.setLayout(pn_emmain_informationLayout);
		pn_emmain_informationLayout
				.setHorizontalGroup(pn_emmain_informationLayout
						.createParallelGroup(GroupLayout.Alignment.LEADING)
						.addGroup(
								pn_emmain_informationLayout
										.createSequentialGroup()
										.addGap(52, 52, 52)
										.addGroup(
												pn_emmain_informationLayout
														.createParallelGroup(
																GroupLayout.Alignment.LEADING)
														.addGroup(
																pn_emmain_informationLayout
																		.createSequentialGroup()
																		.addGroup(
																				pn_emmain_informationLayout
																						.createParallelGroup(
																								GroupLayout.Alignment.LEADING,
																								false)
																						.addGroup(
																								pn_emmain_informationLayout
																										.createSequentialGroup()
																										.addComponent(
																												lblEmName)
																										.addPreferredGap(
																												LayoutStyle.ComponentPlacement.RELATED,
																												49,
																												Short.MAX_VALUE)
																										.addComponent(
																												txtEmName,
																												GroupLayout.PREFERRED_SIZE,
																												156,
																												GroupLayout.PREFERRED_SIZE))
																						.addGroup(
																								pn_emmain_informationLayout
																										.createSequentialGroup()
																										.addGroup(
																												pn_emmain_informationLayout
																														.createParallelGroup(
																																GroupLayout.Alignment.LEADING)
																														.addComponent(
																																lblEmPersonalID)
																														.addComponent(
																																lblEmBirthday))
																										.addGap(18,
																												18,
																												18)
																										.addGroup(
																												pn_emmain_informationLayout
																														.createParallelGroup(
																																GroupLayout.Alignment.LEADING,
																																false)
																														.addComponent(
																																txtEmPersonalID)
																														.addComponent(
																																dateEmBirthday,
																																GroupLayout.DEFAULT_SIZE,
																																156,
																																Short.MAX_VALUE))))
																		.addGap(53,
																				53,
																				53)
																		.addGroup(
																				pn_emmain_informationLayout
																						.createParallelGroup(
																								GroupLayout.Alignment.LEADING)
																						.addGroup(
																								GroupLayout.Alignment.TRAILING,
																								pn_emmain_informationLayout
																										.createSequentialGroup()
																										.addComponent(
																												lblEmAddress)
																										.addGap(18,
																												18,
																												18))
																						.addGroup(
																								pn_emmain_informationLayout
																										.createSequentialGroup()
																										.addComponent(
																												lblEmEmail)
																										.addPreferredGap(
																												LayoutStyle.ComponentPlacement.RELATED,
																												GroupLayout.DEFAULT_SIZE,
																												Short.MAX_VALUE)))
																		.addGroup(
																				pn_emmain_informationLayout
																						.createParallelGroup(
																								GroupLayout.Alignment.LEADING,
																								false)
																						.addComponent(
																								jScrollPane2)
																						.addComponent(
																								txtEmEmail))
																		.addGap(47,
																				47,
																				47)
																		.addGroup(
																				pn_emmain_informationLayout
																						.createParallelGroup(
																								GroupLayout.Alignment.LEADING)
																						.addComponent(
																								lblEmPhone)
																						.addComponent(
																								lblEmSex))
																		.addGap(32,
																				32,
																				32)
																		.addGroup(
																				pn_emmain_informationLayout
																						.createParallelGroup(
																								GroupLayout.Alignment.LEADING)
																						.addComponent(
																								txtEmPhone,
																								GroupLayout.PREFERRED_SIZE,
																								156,
																								GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								cbbEmSex,
																								GroupLayout.PREFERRED_SIZE,
																								64,
																								GroupLayout.PREFERRED_SIZE))
																		.addGap(18,
																				18,
																				18))
														.addGroup(
																pn_emmain_informationLayout
																		.createSequentialGroup()
																		.addGap(3,
																				3,
																				3)
																		.addGroup(
																				pn_emmain_informationLayout
																						.createParallelGroup(
																								GroupLayout.Alignment.LEADING)
																						.addGroup(
																								pn_emmain_informationLayout
																										.createSequentialGroup()
																										.addGroup(
																												pn_emmain_informationLayout
																														.createParallelGroup(
																																GroupLayout.Alignment.LEADING)
																														.addComponent(
																																lblEmId)
																														.addComponent(
																																lblEmPassword))
																										.addGap(28,
																												28,
																												28)
																										.addGroup(
																												pn_emmain_informationLayout
																														.createParallelGroup(
																																GroupLayout.Alignment.LEADING)
																														.addGroup(
																																pn_emmain_informationLayout
																																		.createSequentialGroup()
																																		.addComponent(
																																				txtEmId,
																																				GroupLayout.PREFERRED_SIZE,
																																				156,
																																				GroupLayout.PREFERRED_SIZE)
																																		.addGap(0,
																																				0,
																																				Short.MAX_VALUE))
																														.addGroup(
																																pn_emmain_informationLayout
																																		.createSequentialGroup()
																																		.addComponent(
																																				txtEmPassword,
																																				GroupLayout.PREFERRED_SIZE,
																																				156,
																																				GroupLayout.PREFERRED_SIZE)
																																		.addPreferredGap(
																																				LayoutStyle.ComponentPlacement.RELATED,
																																				GroupLayout.DEFAULT_SIZE,
																																				Short.MAX_VALUE)
																																		.addComponent(
																																				btnEmEdit,
																																				GroupLayout.PREFERRED_SIZE,
																																				100,
																																				GroupLayout.PREFERRED_SIZE)
																																		.addPreferredGap(
																																				LayoutStyle.ComponentPlacement.RELATED)
																																		.addComponent(
																																				btnEmUpdate,
																																				GroupLayout.PREFERRED_SIZE,
																																				100,
																																				GroupLayout.PREFERRED_SIZE)
																																		.addPreferredGap(
																																				LayoutStyle.ComponentPlacement.RELATED)
																																		.addComponent(
																																				btnEmDelete,
																																				GroupLayout.PREFERRED_SIZE,
																																				100,
																																				GroupLayout.PREFERRED_SIZE))))
																						.addGroup(
																								pn_emmain_informationLayout
																										.createSequentialGroup()
																										.addComponent(
																												spEmAddemacc1,
																												GroupLayout.PREFERRED_SIZE,
																												76,
																												GroupLayout.PREFERRED_SIZE)
																										.addPreferredGap(
																												LayoutStyle.ComponentPlacement.RELATED,
																												GroupLayout.DEFAULT_SIZE,
																												Short.MAX_VALUE)
																										.addComponent(
																												lblEmAddemacc)
																										.addPreferredGap(
																												LayoutStyle.ComponentPlacement.RELATED)
																										.addComponent(
																												spEmAddemacc2,
																												GroupLayout.PREFERRED_SIZE,
																												611,
																												GroupLayout.PREFERRED_SIZE)))))
										.addGap(13, 13, 13)));
		pn_emmain_informationLayout
				.setVerticalGroup(pn_emmain_informationLayout
						.createParallelGroup(GroupLayout.Alignment.LEADING)
						.addGroup(
								pn_emmain_informationLayout
										.createSequentialGroup()
										.addContainerGap()
										.addGroup(
												pn_emmain_informationLayout
														.createParallelGroup(
																GroupLayout.Alignment.LEADING)
														.addGroup(
																pn_emmain_informationLayout
																		.createSequentialGroup()
																		.addGap(0,
																				0,
																				Short.MAX_VALUE)
																		.addGroup(
																				pn_emmain_informationLayout
																						.createParallelGroup(
																								GroupLayout.Alignment.LEADING)
																						.addGroup(
																								pn_emmain_informationLayout
																										.createSequentialGroup()
																										.addGroup(
																												pn_emmain_informationLayout
																														.createParallelGroup(
																																GroupLayout.Alignment.BASELINE)
																														.addComponent(
																																txtEmName,
																																GroupLayout.PREFERRED_SIZE,
																																GroupLayout.DEFAULT_SIZE,
																																GroupLayout.PREFERRED_SIZE)
																														.addComponent(
																																lblEmName))
																										.addPreferredGap(
																												LayoutStyle.ComponentPlacement.RELATED)
																										.addGroup(
																												pn_emmain_informationLayout
																														.createParallelGroup(
																																GroupLayout.Alignment.BASELINE)
																														.addComponent(
																																lblEmPersonalID)
																														.addComponent(
																																txtEmPersonalID,
																																GroupLayout.PREFERRED_SIZE,
																																GroupLayout.DEFAULT_SIZE,
																																GroupLayout.PREFERRED_SIZE)))
																						.addGroup(
																								pn_emmain_informationLayout
																										.createSequentialGroup()
																										.addGroup(
																												pn_emmain_informationLayout
																														.createParallelGroup(
																																GroupLayout.Alignment.BASELINE)
																														.addComponent(
																																lblEmPhone)
																														.addComponent(
																																txtEmPhone,
																																GroupLayout.PREFERRED_SIZE,
																																GroupLayout.DEFAULT_SIZE,
																																GroupLayout.PREFERRED_SIZE))
																										.addPreferredGap(
																												LayoutStyle.ComponentPlacement.RELATED)
																										.addGroup(
																												pn_emmain_informationLayout
																														.createParallelGroup(
																																GroupLayout.Alignment.BASELINE)
																														.addComponent(
																																lblEmSex)
																														.addComponent(
																																cbbEmSex,
																																GroupLayout.PREFERRED_SIZE,
																																GroupLayout.DEFAULT_SIZE,
																																GroupLayout.PREFERRED_SIZE))))
																		.addPreferredGap(
																				LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				pn_emmain_informationLayout
																						.createParallelGroup(
																								GroupLayout.Alignment.LEADING)
																						.addComponent(
																								dateEmBirthday,
																								GroupLayout.PREFERRED_SIZE,
																								GroupLayout.DEFAULT_SIZE,
																								GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								lblEmBirthday)))
														.addGroup(
																pn_emmain_informationLayout
																		.createSequentialGroup()
																		.addGroup(
																				pn_emmain_informationLayout
																						.createParallelGroup(
																								GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								lblEmEmail)
																						.addComponent(
																								txtEmEmail,
																								GroupLayout.PREFERRED_SIZE,
																								GroupLayout.DEFAULT_SIZE,
																								GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				pn_emmain_informationLayout
																						.createParallelGroup(
																								GroupLayout.Alignment.LEADING)
																						.addComponent(
																								lblEmAddress)
																						.addComponent(
																								jScrollPane2,
																								GroupLayout.PREFERRED_SIZE,
																								0,
																								Short.MAX_VALUE))))
										.addGap(11, 11, 11)
										.addGroup(
												pn_emmain_informationLayout
														.createParallelGroup(
																GroupLayout.Alignment.TRAILING)
														.addComponent(
																spEmAddemacc2,
																GroupLayout.PREFERRED_SIZE,
																10,
																GroupLayout.PREFERRED_SIZE)
														.addComponent(
																spEmAddemacc1,
																GroupLayout.PREFERRED_SIZE,
																10,
																GroupLayout.PREFERRED_SIZE)
														.addComponent(
																lblEmAddemacc))
										.addPreferredGap(
												LayoutStyle.ComponentPlacement.UNRELATED)
										.addGroup(
												pn_emmain_informationLayout
														.createParallelGroup(
																GroupLayout.Alignment.BASELINE)
														.addComponent(
																txtEmId,
																GroupLayout.PREFERRED_SIZE,
																GroupLayout.DEFAULT_SIZE,
																GroupLayout.PREFERRED_SIZE)
														.addComponent(lblEmId))
										.addPreferredGap(
												LayoutStyle.ComponentPlacement.RELATED)
										.addGroup(
												pn_emmain_informationLayout
														.createParallelGroup(
																GroupLayout.Alignment.BASELINE)
														.addComponent(
																txtEmPassword,
																GroupLayout.PREFERRED_SIZE,
																GroupLayout.DEFAULT_SIZE,
																GroupLayout.PREFERRED_SIZE)
														.addComponent(
																lblEmPassword)
														.addComponent(
																btnEmEdit,
																GroupLayout.PREFERRED_SIZE,
																25,
																GroupLayout.PREFERRED_SIZE)
														.addComponent(
																btnEmUpdate,
																GroupLayout.PREFERRED_SIZE,
																25,
																GroupLayout.PREFERRED_SIZE)
														.addComponent(
																btnEmDelete,
																GroupLayout.PREFERRED_SIZE,
																25,
																GroupLayout.PREFERRED_SIZE))));

		btnEmAdd.setFont(new java.awt.Font("Calibri", 1, 15));
		btnEmAdd.setIcon(new ImageIcon("icon/add.png"));
		btnEmAdd.setText("Add");
		btnEmAdd.setToolTipText("");
		
		
		
		btnEmAdd.addActionListener(controller);
		btnEmEdit.addActionListener(controller);
		btnEmDelete.addActionListener(controller);
		btnEmUpdate.addActionListener(controller);
		btnEmSearch.addActionListener(controller);
		btnEmCancel.addActionListener(controller);
		
		
		
		
		
//		btnEmCancel.addActionListener(new ActionListener() {
//			
//			@Override
//			public void actionPerformed(ActionEvent arg0) {
//				txtEmName.setText("");
//				
//			}
//		});

		btnEmCancel.setFont(new java.awt.Font("Calibri", 1, 15));
		btnEmCancel.setIcon(new ImageIcon("icon/clear.png"));
		btnEmCancel.setText("Clear");

		GroupLayout layout = new GroupLayout(this);
		this.setLayout(layout);
		layout.setHorizontalGroup(layout
				.createParallelGroup(GroupLayout.Alignment.LEADING)
				.addGroup(
						GroupLayout.Alignment.TRAILING,
						layout.createSequentialGroup()
								.addGap(0, 5, Short.MAX_VALUE)
								.addGroup(
										layout.createParallelGroup(
												GroupLayout.Alignment.LEADING,
												false)
												.addComponent(
														pnEmmainListem,
														GroupLayout.DEFAULT_SIZE,
														GroupLayout.DEFAULT_SIZE,
														Short.MAX_VALUE)
												.addComponent(
														pnEmInformation,
														GroupLayout.DEFAULT_SIZE,
														GroupLayout.DEFAULT_SIZE,
														Short.MAX_VALUE))
								.addContainerGap())
				.addGroup(
						layout.createSequentialGroup()
								.addGap(357, 357, 357)
								.addComponent(btnEmAdd,
										GroupLayout.PREFERRED_SIZE, 90,
										GroupLayout.PREFERRED_SIZE)
								.addGap(18, 18, 18)
								.addComponent(btnEmCancel)
								.addContainerGap(GroupLayout.DEFAULT_SIZE,
										Short.MAX_VALUE)));
		layout.setVerticalGroup(layout.createParallelGroup(
				GroupLayout.Alignment.LEADING).addGroup(
				layout.createSequentialGroup()
						.addContainerGap()
						.addComponent(pnEmInformation,
								GroupLayout.PREFERRED_SIZE,
								GroupLayout.DEFAULT_SIZE,
								GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(
								LayoutStyle.ComponentPlacement.UNRELATED)
						.addComponent(pnEmmainListem,
								GroupLayout.PREFERRED_SIZE,
								GroupLayout.DEFAULT_SIZE,
								GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(
								LayoutStyle.ComponentPlacement.RELATED,
								GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
						.addGroup(
								layout.createParallelGroup(
										GroupLayout.Alignment.BASELINE)
										.addComponent(btnEmAdd,
												GroupLayout.PREFERRED_SIZE, 30,
												GroupLayout.PREFERRED_SIZE)
										.addComponent(btnEmCancel,
												GroupLayout.PREFERRED_SIZE, 30,
												GroupLayout.PREFERRED_SIZE))
						.addContainerGap()));

	}
	
	
}
